{extend name="base" /}
{block name="css"}
  <style type="text/css">
    .layui-table-cell{height: auto;}
  </style>
{/block}
{block name="body"}
<div class="layui-card">
  <div class="layui-card-body">
    <blockquote class="layui-elem-quote layui-text">
        订单：<span class="text-danger">禁止</span>修改用户订单信息，仅可<span class="text-danger">发货</span>，导出订单时间为空时。默认导出<span class="text-danger">当天</span>订单信息
    </blockquote>
    <div class="layui-form-item">
      <form class="layui-form layui-form-pane" action="{:request()->url()}" >
        <div class="layui-input-inline">
            <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="{if $Request.get.title}{$Request.get.title}{else}请输入关键字{/if}" class="layui-input">
        </div>
        <div class="layui-input-inline">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">{$Think.lang.search}</button>
            <button type="reset" class="layui-btn layui-btn-primary">{$Think.lang.reset}</button>
        </div>
        </form>
        <button class="layui-btn layui-btn-normal open-popup" data-title="{$Think.lang.export}" data-url="{:url('export')}"><i class="fa fa-plus"></i>{$Think.lang.export}</button>
    </div>
    <table class="layui-table layui-form" lay-skin="line">
      <thead>
        <tr>
          <th>下单人</th>
          <th>订单号</th>
          <th>图片</th>
          <th>商品名称</th>
          <th>数量</th>
          <th>总价</th>
          <th>收件人</th>
          <th>地址</th>
          <th>{$Think.lang.phone}</th>
          <th>下单时间</th>
          <th>支付状态</th>
          <th>{$Think.lang.Handle}</th>
        </tr>
      </thead>
      <tbody>
        {volist name="list" id="v" empty="$empty"}
        <tr>
          <td>{$v.user_name}</td>
          <td>{$v.order_sn}</td>
          <td><img src="{$v.img|default='__IMG__/logo.png'}" alt="" width="50"></td>
          <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{$v.goods_name}</td>
          <td>{$v.goods_number}</td>
          <td>{$v.order_amount}</td>
          <td>{$v.consignee}</td>
          <td>{$v.city}{$v.address}</td>
          <td>{$v.mobile}</td>
          <td>{$v.pay_time|date='Y-m-d'}</td>
          <td>{if $v.order_status eq 5}已取消{elseif $v.order_status eq 4}退换货{elseif $v.order_status eq 3}待评价{elseif $v.order_status eq 2}已完成{elseif $v.order_status eq 1}已确认{else}未确认{/if}、{if $v.pay_status eq 1}已付款{else}未付款{/if}、{if $v.shipping_status eq 2}已收货{elseif $v.shipping_status eq 1}已发货{else}未发货{/if} </td>
          <td>
            <button class="layui-btn layui-btn-xs open-popup" data-title="详情" data-url="{:url('detail', ['id' => $v.id])}"><i class="fa fa-edit"></i>{$Think.lang.see}</button>
            {if $v.shipping_status eq '' || $v.pay_status eq 1}
            <button class="layui-btn layui-btn-xs layui-btn-normal open-popup" data-title="发货" data-url="{:url('send', ['id' => $v.id])}"><i class="fa fa-send-o"></i>发货</button>
            {else}
            <button class="layui-btn layui-btn-xs layui-btn-normal open-popup" data-title="物流 {$v.invoice_no}" data-url="{:url('express', ['id' => $v.id])}"><i class="fa fa-send"></i>物流</button>
            {/if}
            <button class="layui-btn layui-btn-danger ajax-del layui-btn-xs" data-title="{$Think.lang.drop}" data-url="{:url('del', ['id' => $v.id])}"><i class="fa fa-trash-o"></i>{$Think.lang.drop}</button>
          </td>
        </tr>
        {/volist}
      </tbody>
    </table>
    <div class="page">{$list|raw}</div>
  </div>
</div>
{/block}
{block name="js"}
{/block}